#!/bin/sh

# NOTE: Optional items can be installed with server setup

sudo apt-get -y install vim

# 1. Setup SSH (optional)

# sudo apt-get -y install openssh-server

# 2. LAMP (optional)

sudo apt-get -y install lamp-server^
sudo a2enmod rewrite
sudo apt-get -y install php5-gd
 
# 3. Zend

sudo apt-get -y install zend-framework-bin
sudo mv /usr/share/php/libzend-framework-php/Zend/ /usr/share/php

# 4. Subversion

sudo apt-get -y install subversion

# 5. Checkout Code

mkdir webroot
svn checkout https://netshade-2.googlecode.com/svn/trunk/ webroot --username miltonejones@gmail.com --password AH8fk5Ty7Ek6
cd webroot
CURPATH=`pwd`

# 6. Update conf
sudo apt-get -y install inotify-tools

# 7. Run Startup script

sudo cp asset/apache-php.ini /etc/php5/apache2/php.ini
sudo cp asset/cli-php.ini /etc/php5/cli/php.ini
sudo cp asset/my.cnf /etc/mysql/my.cnf
sudo cp default /etc/apache2/sites-available/000-default.conf

sudo service apache2 restart
sudo service mysql restart

mkdir temp/queue/notify
sudo chmod -R 777 temp
sudo chmod -R 777 shadow.net/client

cd sql
mysql --user=root --password=sa < shadow.sql
cd ..







